package dem1;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: 33013
 * Date: 2023-04-05
 * Time: 9:16
 */
public class Test {
    //
    public static int findSpecialInteger(int[] arr) {
        if(arr.length == 1){
            return arr[0];
        }
        int acount = 1;
        for(int i = 0;i < arr.length - 1; i++){
            if(arr[i] == arr[i + 1]){
                acount++;
            }else{
                if(acount > arr.length / 4){
                    return arr[i];
                }
            }
        }
        return arr[arr.length - 1];
    }

    public char firstUniqChar(String s) {
        char[] chars = s.toCharArray();
        int[] arr = new int[26];
        for(int i = 0; i < chars.length; i++){
            arr[chars[i] - 'a']++;
        }
        for(int i = 0; i < chars.length; i++){
            if(arr[chars[i] - 'a'] == 1){
                return chars[i];
            }
        }
        return ' ';
    }

    public static void main(String[] args) {
        //int[] arr = {1,1,2,2,3,3,3,3};
       // findSpecialInteger(arr);
        String str = "";
        if (str == null){
            System.out.println(3);
        }
        str.toCharArray();
        System.out.println(str);
    }
}
